package com.zhanghe.study.spring4.beans.lifecycle;

/**
 * @author zh
 * @date 2021/1/30 18:19
 */
public class Connection {

    private String url;

    public Connection(){
        System.out.println("1.创建");
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        System.out.println("2.设置属性");
        this.url = url;
    }

    public void init(){
        System.out.println("3.初始化");
    }

    public void destory(){
        System.out.println("4.销毁");
    }

    @Override
    public String toString() {
        return "Connection{" +
                "url='" + url + '\'' +
                '}';
    }
}
